/* Style de base */

.carousel-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    max-width: 100%;
}

/* Style des images carrées et légendes */
.carousel-item {
    position: relative;
    overflow: hidden;
    width: 150px;
    height: 150px; /* Forme carrée */
    border-radius: 5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease-in-out;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.caption p {
    text-transform: uppercase; /* Met la légende en majuscule */
    font-weight:bolder;
    color: #dcaf27;
    margin-bottom: 10px;
}
/* Légende centrée dans l'image */
.caption {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0.8;
    font-weight: bold;
    transition: opacity 0.5s ease;
    background: #ffffff;
    padding-top: 10px;
    padding-bottom: 70px;
}

.caption button {
    display: none;
    padding: 5px 10px;
    background-color: #ffffff;
    color: #dcaf27;
    border: none;
    opacity: 0;
    cursor: pointer;
    border-radius: 5px;
}

/* Afficher la légende et le bouton au survol */
.carousel-item:hover {
    animation: growWidth 500ms ease-in-out forwards;
}

/* Définition de l'animation pour agrandir la largeur */
@keyframes growWidth {
    from {
        width: 150px; /* Taille initiale */
    }
    to {
        width: 300px; /* Taille après animation (double) */
    }
}

.carousel-item:not(:hover) {
    animation: resetWidth 300ms ease-in-out forwards;
}
@keyframes resetWidth {
    from {
        width: 300px; /* Taille initiale */
    }
    to {
        width: 150px; /* Taille après animation (double) */
    }
}


.carousel-item:hover img {
    transform: scale(1.05); /* Agrandissement léger de l'image */
}

.carousel-item:hover .caption button {
    display: inline-block;
    opacity: 1;
}

/* Effet de dilatation de l'image en survol, double de la largeur */
/* .carousel-item:hover {
    transform: scaleX(2); /* Double la largeur} */

.carousel-item:hover img {
    transform: scale(1.05); /* Légère expansion de l'image */
    opacity: 1;
}

/* Animation pour faire apparaître les images en fondu */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.carousel-item {
    animation: fadeIn 1s ease-in-out;
}

/* Responsiveness pour mobile */
@media (max-width: 768px) {
    .carousel-container {
        flex-direction: column;
        align-items: center;
    }

    .carousel-item {
        width: 90%;
        height: auto;
    }
}


